package com.iraeta.service.hik.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.iraeta.entity.hik.HikView;
import com.iraeta.mapper.hik.HikViewMapper;
import com.iraeta.service.hik.IHikViewService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 海康的监控视图 服务实现类
 * </p>
 *
 * @author chenbin
 * @since 2024-01-14
 */
@Service
public class HikViewServiceImpl extends ServiceImpl<HikViewMapper, HikView> implements IHikViewService {

    @Override
    public List<HikView> listHikView(Integer createuserid, String name) {
        QueryWrapper<HikView> qw = new QueryWrapper<>();
        qw.eq("createuserid", createuserid);
        if(StrUtil.isNotEmpty(name)){
            qw.like("name", name);
        }
        return baseMapper.selectList(qw);
    }
}
